Integrand size = 21, antiderivative size = 84 \[ \int \frac {\csc ^2(c+d x)}{a+b \sec (c+d x)} \, dx=-\frac {2 a b \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{(a-b)^{3/2} (a+b)^{3/2} d}+\frac {(b-a \cos (c+d x)) \csc (c+d x)}{\left (a^2-b^2\right ) d} \]
[Out]
Time = 0.19 (sec) , antiderivative size = 84, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {3957, 2945, 12, 2738, 214} \[ \int \frac {\csc ^2(c+d x)}{a+b \sec (c+d x)} \, dx=\frac {\csc (c+d x) (b-a \cos (c+d x))}{d \left (a^2-b^2\right )}-\frac {2 a b \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{d (a-b)^{3/2} (a+b)^{3/2}} \]
[In]
[Out]
Rule 12
Rule 214
Rule 2738
Rule 2945
Rule 3957
Rubi steps \begin{align*} \text {integral}& = -\int \frac {\cot (c+d x) \csc (c+d x)}{-b-a \cos (c+d x)} \, dx \\ & = \frac {(b-a \cos (c+d x)) \csc (c+d x)}{\left (a^2-b^2\right ) d}+\frac {\int \frac {a b}{-b-a \cos (c+d x)} \, dx}{a^2-b^2} \\ & = \frac {(b-a \cos (c+d x)) \csc (c+d x)}{\left (a^2-b^2\right ) d}+\frac {(a b) \int \frac {1}{-b-a \cos (c+d x)} \, dx}{a^2-b^2} \\ & = \frac {(b-a \cos (c+d x)) \csc (c+d x)}{\left (a^2-b^2\right ) d}+\frac {(2 a b) \text {Subst}\left (\int \frac {1}{-a-b+(a-b) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{\left (a^2-b^2\right ) d} \\ & = -\frac {2 a b \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{(a-b)^{3/2} (a+b)^{3/2} d}+\frac {(b-a \cos (c+d x)) \csc (c+d x)}{\left (a^2-b^2\right ) d} \\ \end{align*}
Time = 0.48 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.40 \[ \int \frac {\csc ^2(c+d x)}{a+b \sec (c+d x)} \, dx=\frac {\csc \left (\frac {1}{2} (c+d x)\right ) \sec \left (\frac {1}{2} (c+d x)\right ) \left (\sqrt {a^2-b^2} (b-a \cos (c+d x))+2 a b \text {arctanh}\left (\frac {(-a+b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right ) \sin (c+d x)\right )}{2 (a-b) (a+b) \sqrt {a^2-b^2} d} \]
[In]
[Out]
Time = 0.54 (sec) , antiderivative size = 96, normalized size of antiderivative = 1.14
method | result | size |
derivativedivides | \(\frac {\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 a -2 b}-\frac {2 a b \,\operatorname {arctanh}\left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{\left (a -b \right ) \left (a +b \right ) \sqrt {\left (a -b \right ) \left (a +b \right )}}-\frac {1}{2 \left (a +b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}}{d}\) | \(96\) |
default | \(\frac {\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 a -2 b}-\frac {2 a b \,\operatorname {arctanh}\left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{\left (a -b \right ) \left (a +b \right ) \sqrt {\left (a -b \right ) \left (a +b \right )}}-\frac {1}{2 \left (a +b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}}{d}\) | \(96\) |
risch | \(-\frac {2 i \left (-b \,{\mathrm e}^{i \left (d x +c \right )}+a \right )}{d \left (a^{2}-b^{2}\right ) \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}-\frac {b a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+b \sqrt {a^{2}-b^{2}}}{\sqrt {a^{2}-b^{2}}\, a}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right ) \left (a -b \right ) d}+\frac {b a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {-i a^{2}+i b^{2}+b \sqrt {a^{2}-b^{2}}}{a \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right ) \left (a -b \right ) d}\) | \(209\) |
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 300, normalized size of antiderivative = 3.57 \[ \int \frac {\csc ^2(c+d x)}{a+b \sec (c+d x)} \, dx=\left [-\frac {\sqrt {a^{2} - b^{2}} a b \log \left (\frac {2 \, a b \cos \left (d x + c\right ) - {\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, \sqrt {a^{2} - b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right ) + 2 \, a^{2} - b^{2}}{a^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + b^{2}}\right ) \sin \left (d x + c\right ) - 2 \, a^{2} b + 2 \, b^{3} + 2 \, {\left (a^{3} - a b^{2}\right )} \cos \left (d x + c\right )}{2 \, {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} d \sin \left (d x + c\right )}, -\frac {\sqrt {-a^{2} + b^{2}} a b \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \sin \left (d x + c\right )}\right ) \sin \left (d x + c\right ) - a^{2} b + b^{3} + {\left (a^{3} - a b^{2}\right )} \cos \left (d x + c\right )}{{\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} d \sin \left (d x + c\right )}\right ] \]
[In]
[Out]
\[ \int \frac {\csc ^2(c+d x)}{a+b \sec (c+d x)} \, dx=\int \frac {\csc ^{2}{\left (c + d x \right )}}{a + b \sec {\left (c + d x \right )}}\, dx \]
[In]
[Out]
Exception generated. \[ \int \frac {\csc ^2(c+d x)}{a+b \sec (c+d x)} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
none
Time = 0.33 (sec) , antiderivative size = 129, normalized size of antiderivative = 1.54 \[ \int \frac {\csc ^2(c+d x)}{a+b \sec (c+d x)} \, dx=-\frac {\frac {4 \, {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (-2 \, a + 2 \, b\right ) + \arctan \left (-\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {-a^{2} + b^{2}}}\right )\right )} a b}{{\left (a^{2} - b^{2}\right )} \sqrt {-a^{2} + b^{2}}} - \frac {\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a - b} + \frac {1}{{\left (a + b\right )} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}}{2 \, d} \]
[In]
[Out]
Time = 13.81 (sec) , antiderivative size = 109, normalized size of antiderivative = 1.30 \[ \int \frac {\csc ^2(c+d x)}{a+b \sec (c+d x)} \, dx=\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (2\,a-2\,b\right )}-\frac {a-b}{d\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a+b\right )\,\left (2\,a-2\,b\right )}-\frac {2\,a\,b\,\mathrm {atanh}\left (\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2-b^2\right )}{{\left (a+b\right )}^{3/2}\,\sqrt {a-b}}\right )}{d\,{\left (a+b\right )}^{3/2}\,{\left (a-b\right )}^{3/2}} \]
[In]
[Out]